﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// PhieuChiChiTiet Repository. Good example of CRUD operations.
    ///// </summary>
    public class PhieuChiChiTietRepository : IPhieuChiChiTietRepository
    {
        private static readonly IPhieuChiChiTietDao _phieuChiChiTiet = DataAccess.PhieuChiChiTietDao;
        public List<PhieuChiChiTiet> GetList()
        {
            return _phieuChiChiTiet.GetPhieuChiChiTiet().ToList();
        }

        public PhieuChiChiTiet Get(string id)
        {
            return _phieuChiChiTiet.GetPhieuChiChiTietByID(id);
        }

        public void Insert(PhieuChiChiTiet t)
        {
            _phieuChiChiTiet.InsertPhieuChiChiTiet(t);
        }

        public void Update(PhieuChiChiTiet t)
        {
            _phieuChiChiTiet.UpdatePhieuChiChiTiet(t);
        }

        public void Delete(PhieuChiChiTiet t)
        {
            _phieuChiChiTiet.DeletePhieuChiChiTiet(t);
        }
    }
}